/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Missiles;

import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 * Autores:
 * Hugo Hiroshi Yamamura
 * Marina Coimbra Viviani
 * 
 * Classe PlantMissile
 * Misseis com Propriedade de de planta
 * 
 */
public class PlantMissile extends Missile {
    
        private int type = 3;
        private String ballName = "/Sprites/PlantBall.gif";
        
        
     /*
    * 
    * Construtor: PlantMissile
    * @param: coordenada x na qual deseja-se inserir o missil
    * @param2: coordanada y na qual deseja-se inserir o missil
    */        
    public PlantMissile(int x, int y){
        super(x, y);
        ImageIcon ii = new ImageIcon(this.getClass().getResource(ballName));
        this.setImage(ii.getImage());
        visible = true;
        this.setWidth(this.getImage().getWidth(null));
        this.setHeight(this.getImage().getHeight(null));
        this.setX(x);
        this.setY(y);
        this.type = 3;
        
    }
    
    
     /*
    * 
    * Metodo: paint
    * Funcionamento: pinta o missil no JPanel.
    */
     @Override
    public void paint(Graphics g, JPanel panel){
        if(this.isVisible()){
            Graphics2D g2d = (Graphics2D)g;
            g2d.drawImage(this.getImage(), this.getX(), this.getY(), panel);
        }
    }
     
     
    /*
    * 
    * Metodo: getType
    *
    * @return o tipo correto do missil. (Planta).
    */ 
     
    @Override
    public int getType(){
        return this.type;
    }
        
}
 
